// 主页js
import request from '@/utils/request'

// 获取天团排行榜
export function getGuildList(obj) {
	return request({
		url: '/guild/getGuildList?curPage=' +
			obj.curPage +
			"&curPageSize=" +
			obj.curPageSize,
		method: 'get',
	})
}
// 获取我的天团的详情
export function getGuildDetail(obj) {
	return request({
		url: '/guild/getGuildDetail?guildId=' +
			obj.id +
			"&type=" +
			obj.type,
		method: 'get',
	})
}

// 检测工会名称
export function detectionGuildNameLegal(obj) {
	return request({
		url: '/guild/detectionGuildNameLegal?guildName=' + obj.uniName,
		method: 'get',
	})
}

// 创建天团条件
export function createGuildSetting() {
	return request({
		url: '/guild/auth/createGuildSetting',
		method: 'get',
	})
}


// 创建天团
export function createGuild(obj) {
	return request({
		// url: '/guild/createGuild/?guildName=' + obj.uniName + "&settingId=" + obj.value,
		url: '/guild/createGuild/?guildAvatar=' + obj.guildAvatar + "&guildName=" + obj.uniName +
			"&settingId=" + obj.value,
		method: 'get',
	})
}
// 加入天团
export function joinGuild(obj) {
	return request({
		url: "/guild/joinGuild?id=" + obj.uniId,
		method: 'get',
	})
}


// 退出天团
export function exitGuild(obj) {
	return request({
		url: '/guild/exitGuild/?id=' + obj.id,
		method: 'get',
	})
}

//是否是我的天团
export function checkMyGuild(obj) {
	return request({
		url: '/guild/checkMyGuild',
		method: 'get',
	})
}

//天团成员列表
export function getGuildMemberList(obj) {
	return request({
		url: "/guild/getGuildMemberList/?curPage=" +
			obj.curPage + //当前页 
			"&curPageSize=" + //当前页有多少条数据
			obj.curPageSize + //成员的id
			"&guildId=" +
			obj.guildId,
		method: 'get',
	})
}

//设置职位(长老)
export function setIdEntity(obj) {
	return request({
		url: "/guild/setIdEntity/?idEntity=" + obj.idEntity + "&toMemberId=" + obj.memeberId,
		method: 'post',
	})
}


//成员详情
export function getMemberProperty(obj) {
	return request({
		url: "/guild/getMemberProperty?memberId=" + obj.memberId,
		method: 'get',
	})
}


//天团仓库
export function getGuildStoreList(obj) {
	return request({
		url: "/guild/getGuildStoreList/?curPage=" +
			obj.curPage +
			"&curPageSize=" +
			obj.curPageSize +
			"&guildId=" +
			obj.guildId,
		method: 'get',
	})
}


//天团奖励分配
export function sureAwardAllot(data) {
	return request({
		url: "/guild/sureAwardAllot",
		method: 'post',
		data: data
	})
}


// //天团分配记录
// export function guildAllocationRecord(data) {
// 	return request({
// 		url: "/guild/guildAllocationRecord/" +
// 			data.curPage +
// 			"/" +
// 			data.curPageSize,
// 		method: 'get',
// 	})
// }

//天团分配记录详情
export function guildAllocationRecordDetail(data) {
	return request({
		url: "/guild/guildAllocationRecordDetail/" +
			data.page +
			"/" +
			data.size +
			"?allocationId=" +
			data.id,
		method: 'get',
	})
}

//天团劝退成员
export function kickOutGuild(data) {
	return request({
		url: "/guild/kickOutGuild/?guildId=" +
			data.guildId +
			"&kickOutMemberId=" +
			data.memeberId,
		method: 'get',
	})
}

//天团申请加入列表
export function getApplyGuildList(data) {
	return request({
		url: "/guild/getApplyGuildList/?curPage=" +
			data.curPage +
			"&curPageSize=" +
			data.curPageSize +
			"&guildId=" +
			data.guildId,
		method: 'get',
	})
}

//天团申请加入列表
export function auditApplyGuild(data) {
	return request({
		url: "/guild/auditApplyGuild?applyId=" +
			data.applyId +
			"&state=" +
			data.state,
		method: 'get',
	})
}

//天团升级
export function judgeGuildUpgrade(data) {
	return request({
		url: "/guild/judgeGuildUpgrade",
		method: 'post',
	})
}


//分配奖励是否同意
export function getguildAllocation(data) {
	return request({
		url: "/guild/examineAllot/" +
			data.allotId +
			"/" +
			data.state,
		method: 'post',
	})
}

// 天团分配记录
export function meetingHallRecord(data) {
	return request({
		url: "/guild/guildAllocationRecord/" +
			data.page +
			"/" +
			data.size,
		method: 'get',
	})
}

// 查看分配记录

export function lookAllot(data) {
	return request({
		url: "/guild/lookAllot/" + data.allotId,
		method: 'get',
	})
}

// 设置默认审核


export function defaultSettings(data) {
	return request({
		url: "/guild/defaultSettings/" + data.guildId + "/" + data.state,
		method: 'post',
	})
}
// 默认审核状态
export function getDefaultSettings(data) {
	return request({
		url: "/guild/getDefaultSettings/" + data.guildId,
		method: 'get',
	})
}
// 默认繁育excel列表
export function getExcelList(data) {
	return request({
		url: "/guild/excelList",
		method: 'get',
	})
}

// 生成繁育excel

export function getGenerateExcel(data) {
	return request({
		url: "/guild/generateExcel",
		data: data,
		method: 'post',
	});
}

// 获取繁育excel
export function getBreedExcel(data) {
	return request({
		url: "/guild​/getBreedExcel​/" + data.excelId,
		data: data,
		method: 'post',
	});
}